package com.koron.common.core.interceptor.adapterImpl;

import com.koron.bean.enums.OperationMode;
import com.koron.common.core.config.ThreadLocalContext;
import com.koron.common.core.interceptor.FieldAdapter;
import org.springframework.stereotype.Component;

/**
 * @author jzp
 * @since 2021/9/28
 */
@Component
public class DeptNameAdapter implements FieldAdapter {

    @Override
    public Object defaultValue() {
        return ThreadLocalContext.get().getDeptName();
    }

    @Override
    public OperationMode getOperationMode() {
        return OperationMode.INSERT;
    }

    @Override
    public String[] fields() {
        return new String[]{"deptName"};
    }
}
